/*
 * @Author: your name
 * @Date: 2021-07-18 14:17:58
 * @LastEditTime: 2021-08-02 00:07:20
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \blog-work\gridsome.config.js
 */
// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config

// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`

module.exports = {
  siteName: 'Gridsome',
  plugins: [
    {
      use: '@gridsome/source-filesystem',
      options: {
        typeName: 'BlogPost',    //生成的数据集的名称
        path: './content/blog/**/*.md',   //抓取的数据的路径
      }
    },
    {
      use: '@gridsome/source-strapi',
      options: {
        // apiURL: 'http://localhost:1337',
        apiURL: 'http://47.106.13.30:1337',
        queryLimit: 1000, // Defaults to 100
        contentTypes: ['posts'],
        // singleTypes: ['impressum'],    //单个节点
        // Possibility to login with a Strapi user,
        // when content types are not publicly available (optional).
        loginData: {
          identifier: '',
          password: ''
        }
      }
    }
  ],
  transformers: {
    remark: {
      // global remark options
    }
  },
  templates: {
    StrapiPosts: [    //模板名称必须是Strapi + 拉取的数据集合的名称   这个页面不能用模板在serverjs 里面建   
      {
        path: '/post/:id',
        component: './src/templates/post.vue'
      }
    ]
  }
}
